package part14_迭代器模式_统一遍历问题.源码分析_Iterator的源码;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * @ClassName: IteratorDemo
 * @Author: AllenSun
 * @Date: 2020/3/8 15:01
 */
public class IteratorDemo {
    public static void main(String[] args) {
        List<String> list=new ArrayList<>();
        list.add("jack");
        Iterator iterator=list.iterator();
        while (iterator.hasNext()){
            System.out.println(iterator.next());
        }
    }
}
